package com.lz.rocketmq.consumer2.project.listener;

import com.lz.rocketmq.consumer2.common.utils.DateUtils;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

@Service
@RocketMQMessageListener(topic = "trade-topic", consumerGroup = "c2")
public class ConsumerTradeService implements RocketMQListener<String> {

    public static String t = null;

    @Override
    public void onMessage(String message) {
        t = message;
        System.out.printf(DateUtils.getCurr_YYYY_MM_DD_HH_MM_SS_SSS()+"-------c2 trade StringConsumer received: %s \n", message);
    }


    public String getReceive() {
        return t;
    }
}